import Vue from 'vue'
import Vuex from 'vuex'

import Login from './modules/login'
import NewNotice from './modules/notice'
import OneTool from './modules/tool'
import TwoReview from './modules/review'
import TwoProcess from './modules/process'
import TwoEnter from './modules/enter'
import ThreeDispatch from './modules/dispatch'
import FiveInspection from './modules/inspection'
import SixAttendance from './modules/attendance'
import User from './modules/user'
import BiReport from './modules/bi'

import Report from './pages/reports'

// 页面组件pageSession缓存
import DispatchDetail from './pages/dispatch_details'

Vue.use(Vuex)

interface IRoute {
  path: string
  name: string
  title: string
}
const state: any = {
  routeTabs: [
    {
      path: '/home',
      name: 'home',
      title: '首页'
    }
  ],
  isCollapse: false,
}
const store = new Vuex.Store({
  modules: {
    Login,
    NewNotice,
    OneTool,
    TwoReview,
    TwoProcess,
    TwoEnter,
    ThreeDispatch,
    FiveInspection,
    SixAttendance,
    User,
    BiReport,
    DispatchDetail,
    Report
  },
  state,
  getters: {},
  mutations: {
    SET_ROUTE_TABS(state, payload) {
      state.routeTabs = payload
    },
    SET_IS_SIGNED(state, payload) {
      state.is_signed = payload
    },
    SET_IS_UPLOAD(state, payload) {
      state.is_upload = payload
    },
    SET_IS_COLLAPSE(state, payload) {
      state.isCollapse = payload
    },
  },

  actions: {}
})
export default store
